SpatialStream® Code Examples

School Districts

Using SpatialStream® School District layer, SLD (Stylized Layer Descriptor), and GetMap components, you can access nationwide School District data and basic attributes for display in your mapping application. This example will demonstrate how to add School District data for the entire US. The SLD component allows you to apply a map style based on attributes in the School District layer and tailor the following display parameters of School Districts: color, border-color, opacity, and border width. Once the SLD is defined, the GetMap component generates the overlay for your map.

The primary benefit of defining a layer’s style in an SLD is that the layer style definitions are maintained outside the code, so making changes to the layer style are fast and easy as application code doesn’t need to be changed to do so. Because layer styling is separate from the application, you have the option of letting data visualization experts style your layers, who may not necessarily be your application programmers.

SLD | GetMap


layer = new Dmp.Layer.WmsLayer("SD", "SS");
layer.addChild("poly", "SS.Admin.MP.SchoolDistricts/SchoolDistricts", "PUBLIC_FOLDER/Styles/SchoolDistricts_Maponics/Default.sld.xml", {
zIndex: 100, zoomRange: {
min: 4, max: 19
}
});
map.addEntity(layer);

//----------------

var url = "Identify.aspx" +
"?returnGeoType=3" +
"&dataSource=SS.Admin.MP.SchoolDistricts/SchoolDistricts" +
"&showSchema=false" +
"&lat=" + loc.latitude +
"&long=" + loc.longitude +
"&fields=*";


var filter = getFilter().replace("&", "%26");

if (filter.length > 0) {

url += "&query=" + filter;
}

Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback);


Run Sample   Back To Index